home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / driverkit / debuggingMsg.h < prev    next >
Text File  |  1993-02-16  |  2KB  |  79 lines

  1. /*     Copyright (c) 1991 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * debuggingMsg.h - exported interface to driver debugging module (DDM) 
  4.  *          server. This interface is used by Apps like Viewers 
  5.  *          and other modules which must collect and/or analyze 
  6.  *          DDM data (as opposed to those modules which generate 
  7.  *          DDM data).
  8.  *
  9.  * HISTORY
  10.  * 22-Feb-91    Doug Mitchell at NeXT
  11.  *      Created. 
  12.  */
  13.  
  14. #import <mach/message.h>
  15. #import <kernserv/clock_timer.h>
  16.  
  17. /*
  18.  * Message format for communicating with DDM server.
  19.  */
  20. #define IO_DDM_STRING_LENGTH    128
  21.  
  22. typedef struct {
  23.     msg_header_t     header;            // standard header 
  24.     msg_type_t    argType;        // describes args
  25.     unsigned    index;            // index into 
  26.                         // IODebuggingMasks[] or
  27.                         // actual log array 
  28.     unsigned    maskValue;    
  29.     unsigned    status;            // I/O result
  30.     
  31.     /*
  32.      * TBD - can't pass long longs in mach message (yet).
  33.      * As of 30 Nov. 92, all IODebuggingMsg's contain 32 bits of
  34.      * microseconds in timestampLowInt, stored big-endian.
  35.      */
  36.     unsigned    timestampHighInt;
  37.     unsigned    timestampLowInt;
  38.     int        cpuNumber;
  39.     msg_type_t    stringType;        // describes string
  40.     char        string[IO_DDM_STRING_LENGTH];
  41. } IODDMMsg;
  42.  
  43. /*
  44.  * Values for IODebuggingMsg.header.msg_id.
  45.  */
  46. #define IO_DDM_MSG_BASE            0x545454
  47. #define IO_LOCK_DDM_MSG            (IO_DDM_MSG_BASE + 0)    
  48.                     // freeze state of DDM
  49. #define IO_UNLOCK_DDM_MSG        (IO_DDM_MSG_BASE + 1)    
  50.                     // unfreeze state of DDM
  51. #define IO_GET_DDM_ENTRY_MSG        (IO_DDM_MSG_BASE + 2)    
  52.                     // get a DDM string 
  53. #define IO_SET_DDM_MASK_MSG        (IO_DDM_MSG_BASE + 3)    
  54.                     // set IODDMMasks
  55. #define IO_CLEAR_DDM_MSG        (IO_DDM_MSG_BASE + 4)    
  56.                     // clear DDM log
  57.                             
  58. /*
  59.  * Values for IODebuggingMsg.status.
  60.  */
  61. #define IO_DDM_SUCCESS        0
  62. #define IO_NO_DDM_BUFFER    1        // no entry at specified
  63.                         //     offset
  64. #define IO_BAD_DDM_INDEX    2        // invalid index
  65.  
  66. /*
  67.  * Extract an unsigned long long from msg->timestampHighInt and
  68.  * msg.timestampLowInt.
  69.  */
  70. static inline ns_time_t IONsTimeFromDDMMsg(IODDMMsg *msg)
  71. {
  72.     ns_time_t ns;
  73.     
  74.     ns = ((unsigned long long)(msg->timestampHighInt)) << 32;
  75.     ns += msg->timestampLowInt;
  76.     return ns;
  77. }
  78.  
  79.